<?php
	require_once("../includes/barramenu.php") ;
	require_once("../includes/gridView.php")  ;
	$oBarra = new BarraMenu() 				  ;
	$Grid1 = new GridView()					  ;
?>
<!DOCTYPE html>
<html lang="es">
<head>
<title>Mantenimiento kardex</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="../../includes/css/jquery-ui-notarios.css" rel="stylesheet" type="text/css"/>
<link href="../includes/scrollableFixedHeaderTable.css" rel="stylesheet" type="text/css"/>
<link rel="stylesheet" type="text/css" href="../../tcal.css" />
<script src="../../includes/js/jquery-1.9.0.js"></script>
<script src="../../includes/js/jquery-ui-notarios.js"></script>
<script type="text/javascript" src="../../tcal.js"></script> 
<script type="text/javascript" src="../includes/jquery.scrollableFixedHeaderTable.js"></script>
<script language="JavaScript" type="text/javascript" src="../../ajax2.js"></script>
<script language="JavaScript" type="text/javascript" src="../../includes/script1.js"></script>
<script language="JavaScript" type="text/javascript" src="../includes/ext_script1.js"></script>
<style type="text/css">
<!--
#title_client{
background-color: #ffffff;
border: 4px solid #264965;  
-moz-border-radius: 13px;
-webkit-border-radius: 13px;
border-radius: 13px;
-moz-box-shadow: 0px 0px 5px #000000;
-webkit-box-shadow: 0px 0px 5px #000000;
box-shadow: 0px 0px 5px #000000;	
}
div.frmclientes
{ 
background-color: #ffffff;
border: 4px solid #264965;  
-moz-border-radius: 13px;
-webkit-border-radius: 13px;
border-radius: 13px;
-moz-box-shadow: 0px 0px 5px #000000;
-webkit-box-shadow: 0px 0px 5px #000000;
box-shadow: 0px 0px 5px #000000;
width:820px; height:750px;
}

.submenutitu {
	font-family: Calibri;
	font-size: 18px;
	font-style: italic;
	color:#FF9900;
}
#frmclientes{
	padding-bottom:0px;
	margin-bottom:0px;
	}
<!-- ini table -->
.GridPar
{
	border:0px;
	border-spacing:0px;
	border-collapse:0px;
	font:Arial, Helvetica, sans-serif;
	font-size:11px;
	color:#300;
	cursor:pointer;
	background-color:#FFFFFF;
}
.GridParx
{
	border:0px;
	border-spacing:0px;
	border-collapse:0px;
	font:Arial, Helvetica, sans-serif;
	font-size:11px;
	color:#300;
	cursor:pointer;
	background-color:#FFFFFF;
}
.GridImp
{
	border:0px;
	border-spacing:0px;
	border-collapse:0px;
	font:Arial, Helvetica, sans-serif;
	font-size:11px;
	color:#300;
	cursor:pointer;
	background-color:#E8E8E8;
}
.GridCab
{
	font-size:17px;
	
}
<!-- end table -->

.line {color: #FFFFFF}
.titulosprincipales {	font-family: Calibri;
	font-size: 14px;
	color: #FF9900;
	font-style: italic;
}

.Estilo7 {font-family: Calibri; font-size: 13px; font-style: italic; }
.Estilo14 {font-family: Calibri; font-size: 12px; color: #333333; font-weight: bold; }
.Estilo12 {font-family: Calibri; font-size: 12px; color: #333333; font-style: italic; cursor:pointer; }
-->
</style>
<script type="text/javascript">
$(document).ready(function(){ 

$("#frmclientes").dialog({height:800, width:740, position :["center","top"],  opacity: 0.1, style: "margin:0px; padding:0px; float:none;",resizable:false,title:'Mant. de Impedidos'}); 
	 //$("input, textarea, select, button").uniform();
	 $("button").button();
	 $("#dialog").dialog();
	 $(".ui-dialog-titlebar").hide();
	 //muestragrid();
	  fmuestraGrid();
	})
$('#btncerrar2').click( function() { alert('das');
    $("#frmclientes").dialog("close");
});
function muesdatos()
{
	muestragrid();
}
function cerrar2(){
    $("#frmclientes").dialog("close");	
}

function selectidkar(id) {
	
document.getElementById('datos').value = id;
}

// #= function show detail -> Grid View
function fShowDetail(obj)

		{
			var _id = obj.cells[0].innerHTML;
			var _gridView = document.getElementById('gridImpedidos');
			var _rows  = _gridView.rows.length;
			for(i=1;i<=_rows-1;i++)
				{
					if(i%2==0)
						{
							_gridView.rows[i].style.backgroundColor = '#FFFFFF';
						}
					else
						{
							_gridView.rows[i].style.backgroundColor = '#E8E8E8';
						}
				}
			obj.style.backgroundColor = '#b4b4b4'; 
			
			var fil=obj.id;
			document.getElementById('txtfilas').value=fil;

			    _datos =  $GridData(obj);
				
				document.getElementById('idimpedido').value = _datos[0];
				document.getElementById('idcliente').value = _datos[1];
				document.getElementById('descliente').value = _datos[2];
				document.getElementById('fechaing').value = _datos[3];
				document.getElementById('oficio').value = _datos[4];
				document.getElementById('origen').value = _datos[5];
				document.getElementById('motivo').value = _datos[6];
				document.getElementById('pep').value = _datos[7];
				document.getElementById('laft').value = _datos[8];
		}
// #= fin funcion show detail 


function editclie(_obj){
var _idimpedido = document.getElementById('idimpedido').value;
var _idcliente  = document.getElementById('idcliente').value;
var  _descli    = document.getElementById('descliente').value;
var _fechaing   = document.getElementById('fechaing').value;
var _oficio     = document.getElementById('oficio').value;
var _origen     = document.getElementById('origen').value;
var _motivo     = document.getElementById('motivo').value;
var _pep        = document.getElementById('pep').value;
var _laft       = document.getElementById('laft').value; 				 

$('<iframe id="frame1" class="window-Frame" frameborder="0" src="../controller/EditImpedidos.php?idimpedido='+_idimpedido+'&idcliente='+_idcliente+'&descli='+_descli+'&fechaing='+_fechaing+'&oficio='+_oficio+'&origen='+_origen+'&motivo='+_motivo+'&pep='+_pep+'&laft='+_laft+'"/>').dialog({
				autoOpen: true,
				position :["center","top"],
                width   : 460,
                height  : 400,
                modal:false,
                resizable:false,
                title:'Editar Datos de Impedido'
				
                }).width(460).height(400);	
	}
	
	function agregar(){
		$('<div id="frame_newImpedido" title="frame_newImpedido"></div>').load('../controller/newImpedido.php')
		.dialog({
					autoOpen: true,
					position :["center","top"],
					width   : 670,
					height  : 680,
					modal:false,
					resizable:false,
					buttons: [{id: "btnaceptar", text: "Aceptar",click: function() {ggclie1(); $(this).dialog("destroy").remove();  }},
						{text: "Cancelar",click: function() {$(this).dialog("destroy").remove();  }}],
					title:'Nuevo Cliente Impedido'
					}).width(670).height(680);
					$(".ui-dialog-titlebar").hide();	
		}

	function focusSearch(evento)
	{if(evento.keyCode==13){document.getElementById('Buscar').focus();}} 

	function frefresh(){window.location.reload();}
	
	function fbusca(_val)
	{
		var combo = document.getElementById('tippersona').value;
		if(combo == "")
		{alert('Seleccione tipo de persona');return;}
	
		$("#dgrid_kardex").load('list_impedidos.php' ,	{_epublic  : combo,		val      : _val	}, function(){
				$('#gridImpedidos').scrollableFixedHeaderTable(700,500,null,null);
			});
	}	

	function fmuestraGrid()
	{
		var _ini="ini";
		$("#dgrid_kardex").load('list_impedidos.php', 	{_epublic  : _ini}, function(){
				$('#gridImpedidos').scrollableFixedHeaderTable(700,500,null,null);
			});
	}	
		
</script>
</head>

<body style=" font-size:63.5%;">
<div  id="frmclientes" style="background-color: #ffffff;
border: 4px solid #264965;  
-moz-border-radius: 13px;
-webkit-border-radius: 13px;
border-radius: 13px;
-moz-box-shadow: 0px 0px 5px #000000;
-webkit-box-shadow: 0px 0px 5px #000000;
box-shadow: 0px 0px 5px #000000;
width:950px; height:800px;">
<form id="frmprotocolares" name="frmprotocolares" method="post" action="actualizar_kardex.php">
<table id="title_client" width="100%" bgcolor="#264965" bordercolor="#264965" cellpadding="0" cellspacing="0">
 <tr>
<td width="36" height="28" align="center" bgcolor="#264965"><img src="../../iconos/nuevo2.png" width="20" height="22" /></td>
              <td width="745" bgcolor="#264965"><span class="submenutitu">Mantenimiento de Impedidos</span></td>
              <td width="28" bgcolor="#264965"><a  onClick="cerrar2()" id="btncerrar" href="#"><img id="btncerrar" src="../../iconos/cerrar.png" width="21" height="20" border="0" /></a></td>
            </tr>
            <tr></tr>
</table>

  <table width="100%" border="0" cellspacing="0" cellpadding="0">
    <tr>
      <td height="19">
      				  <input name="datos" id="datos" type="hidden" />
      				  <input name="idimpedido" id="idimpedido" type="hidden" />
                      <input name="idcliente" id="idcliente" type="hidden" />
                      <input name="descliente" id="descliente" type="hidden" />
                      <input name="fechaing" id="fechaing" type="hidden" />
                      <input name="oficio" id="oficio" type="hidden" />
                      <input name="origen" id="origen" type="hidden" />
                      <input name="motivo" id="motivo" type="hidden" />
                      <input name="pep" id="pep" type="hidden" />
                      <input name="laft" id="laft" type="hidden" />
                      <input name="txtbuscar" id="txtbuscar" type="hidden" />
                      
<table width="100%" height="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
	<td>
    
    <input type="hidden" id="txtfilas" name="txtfilas" value="" />
            <table width="710" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td width="164"><span class="Estilo7">
                  <?php
				$oBarra->Nuevo      = "1"           	  ; 
				$oBarra->NuevoClick = "agregar();"   	  ; 
				//$oBarra->refresh      = "1"          	  ;
				//$oBarra->refreshClick = "frefresh();"     ;
				$oBarra->clase      = "css"      		  ; 
				$oBarra->Show()  						  ; 
				?>
                  </span></td>
              </tr>
                <tr>
                  <td><span class="titubuskar0">
                    <label>
                      <select name="tippersona" id="tippersona" style="font-size:12px;">
                        <option value ="" selected="selected">TIPO DE PERSONA</option>
                        <option value="N">Natural</option>
                        <option value="J">Jurídica</option>
                      </select>
                    </label>
                  </span></td>
                  <td width="187" align="right" style="font-size:12px;"><span class="titubuskar0"> NOMBRE DEL CLIENTE: </span> </td>
                  <td width="348"><input  name="descrio" type="text" id="descrio" size="45"  onKeyUp="fbusca(this.value)"/></td>
                  <td width="11">&nbsp;</td>
                </tr>
            </table>
                  
    </td>
</tr>
<tr><td valign="top"  height="19" width="710">
<div id="dgrid_kardex" style="width:705px; height:570px; overflow:auto;">
</div></td>
        </tr>
</table>
  </form>
</div>

</body>
</html>
